package elsim.entities

import java.util.Arrays;

import com.google.common.collect.ImmutableList;

/**
 * I understand that all classes with name ending "Manager" are of pure evil
 * and should be demolished, destroyed, deleted, and decomissioned, but for 
 * the love of kittens, I can't come up with a better name.
 */
class LiftManager {
  private ImmutableList<Lift> lifts;

  public void initialize(int liftsCount) {
    Lift[] liftsArray = new Lift[liftsCount]

    for (int i = 0; i < liftsCount; ++i) {
      liftsArray[i] = new Lift(i)
    }

    this.lifts = ImmutableList.copyOf(Arrays.asList(liftsArray))
  }

  public Iterable<Lift> getLifts() {
    return lifts;
  }

  public Lift getLift(int liftId) {
    return lifts.get(liftId)
  }
  
  private LiftManager(){}
  
  private static final LiftManager instance = new LiftManager();
  public static final LiftManager getLiftManager() {
    return instance
  }
}
